import { _decorator, Component, Node, Sprite, resources, SpriteFrame, UITransform, Layers } from 'cc';

export const createUINode = (name: string = null) => {
    const node = new Node(name);
    const transform = node.addComponent(UITransform);
    transform.setAnchorPoint(0, 1);
    node.layer = 1 << Layers.nameToLayer('UI_2D');
    return node;
}

export const randomByRange = (min: number, max: number) => { return Math.floor(min + (max - min) * Math.random()) }
